package com.itheima.test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.TreeSet;
import static java.lang.Double.parseDouble;
import static java.lang.System.*;

public class ZuoYe3 {
    public static void main(String[] args) {
        //Scanner sc = new Scanner(in);
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); //
        TreeSet<Double> tr = new TreeSet<Double>((Double o1, Double o2) -> {
            if (o1 - o2 < 1 && o1 - o2 >= 0) {
                return -1;
            } else if (o1 - o2 < 0) {
                return 1;
            } else return (int) (o2 - o1);
        }
        );
        double v = 0;
        while (v != 886) {
            //判断是否输入的数据
            try {
                out.println("请输入：");
                String s = br.readLine();
              //  String s = sc.nextLine();
                v = parseDouble(s);
                if (v != 886) {
                    tr.add(v);
                }
            } catch (NumberFormatException | IOException e) {
                out.println("数据异常");
            }
        }
        out.println(tr);
    }
}
